package com.itheima.a01staticdemo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86131
 * Date: 2024-02-04
 * Time: 21:15
 */
public class StudentTest {
    public static void main(String[] args) {
        //创建学生对象
        Student s1 = new Student();
        Student.teacherName = "蔡军";   //变成类变量,被该类所有对象共享

        s1.setName("张三");
        s1.setAge(23);
        s1.setGender("男");
        //s1.teacherName="蔡军";

        s1.study();
        s1.show();

        //2.第二个学生对象
        Student s2 = new Student();
        s2.setName("李四");
        s2.setAge(24);
        s2.setGender("女");

        s2.study();
        s2.show();
    }
}
